﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimStatus.Core
{
    public interface  IMainPage
    {
        #region 公共属性
        Random ran { get; set; }

        bool IsDial { get; set; }
        StatusEntity Status { get; set; }

        String PortName { get; set; }

        String PortNumber { get; set; }

        String DialerName { get; set; }

        List<Log> Logs { get; set; }

        #endregion

        #region 公共方法
        /// <summary>
        /// 尝试连接到通讯端口
        /// </summary>
        /// <param name="PortName">端口名称</param>
        /// <param name="PortNumber">端口速率</param>
        /// <returns>连接结果</returns>
        ConnectResult ConnectToPort(String PortName,String PortNumber);
        /// <summary>
        /// 初始化托盘图标
        /// </summary>
        void InitIcon();
        /// <summary>
        /// 显示对话框
        /// </summary>
        void ShowDialog();
        /// <summary>
        /// 关闭对话框
        /// </summary>
        void CloseDialog();
        /// <summary>
        /// 终结程序
        /// </summary>
        void Terminate();
        /// <summary>
        /// 获取信号强度
        /// </summary>
        /// <returns></returns>
        String GetCSQ();
        /// <summary>
        /// 获取运营商信息
        /// </summary>
        /// <returns></returns>
        String GetCops();
        /// <summary>
        /// 执行AT命令
        /// </summary>
        /// <param name="Command">AT命令</param>
        /// <returns></returns>
        String ExcuteAtCommang(String Command);
        /// <summary>
        /// 执行命令行指令
        /// </summary>
        /// <param name="CMD">命令行指令</param>
        /// <returns></returns>
        String ExcuteCMD(String CMD);
        /// <summary>
        /// 拨号
        /// </summary>
        String Dial();
        /// <summary>
        /// 断开拨号
        /// </summary>
        String UnDial();
        /// <summary>
        /// 创建连接
        /// </summary>
        /// <returns></returns>
        bool CreateDial();
        /// <summary>
        /// 更换托盘图标
        /// </summary>
        /// <param name="icon"></param>
        void ChangeIcon(System.Drawing.Icon icon);
        /// <summary>
        /// 向主窗体中添加一个内容
        /// </summary>
        /// <param name="obj">内容通常为UserControl</param>
        void ShowContent(IContent obj);
        /// <summary>
        /// 获取用户拨号连接列表
        /// </summary>
        /// <returns></returns>
        List<String> GetAllUserPhoneBook();

        void Report(Log log);

        void Report(List<Log> logs);
        #endregion


    }

    public enum ConnectResult
    {
        Connected, Disconnected, NoSim, Error
    }
}
